package com.hs.srm.admin.modules.bills.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hs.srm.admin.modules.vendor.entity.VendorInfoEntity;
import com.hs.srm.base.common.base.CloneableEntity;

/*
 * 对账表表头
*/
@Setter
@Getter
@TableName("scm_bills_header")
@ToString
public class ScmBillsHeaderEntity implements Serializable, CloneableEntity<ScmBillsHeaderEntity> {

	@Override
	public ScmBillsHeaderEntity clone() {
		try {
			return (ScmBillsHeaderEntity)super.clone();
		} catch(CloneNotSupportedException ex) {
			// TODO Auto-generated catch block
			ex.printStackTrace();
		}
		return null;
	}

	// 对账单审核状态
	// 未操作0，第一次通过1，第二次通过2，第三次通过3；第一次未通过-1，第二次未通过-2，第三次未通过-3
	public static final class BillsStatus {
		public static final int INIT = 0;
		public static final int PASS1 = 1;
		public static final int PASS2 = 2;
		public static final int PASS3 = 3;
		public static final int FAIL1 = -1;
		public static final int FAIL2 = -2;
		public static final int FAIL3 = -3;
	}

	// 对应的发票状态
	// 0未开票；1已开票未审批；2开票审批通过；-2开票审批未通过; 3开票成功；-3开票失败
	public static final class InvoiceStatus {
		public static final int INIT = 0;
		public static final int YIKAIPAI_WEISHENPI = 1;
		public static final int SHENPI_TONGGUO = 2;
		public static final int SHENPI_BOHUI = -2;
		public static final int KAIPIAO_CHENGGONG = 3;
		public static final int KAIPIAO_SHIBAI = -3;
	}

	private static final long serialVersionUID = -7956616928280463439L;

	@TableId(value = "pk_id", type = IdType.UUID)
	@TableField("pk_id")
	private String pkId;

	@TableField("bill_no")
	private String billNo;

	@TableField("vendor_id")
	private String vendorId;

	@TableField("sum_money")
	private BigDecimal sumMoney;

	@TableField("create_date")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	private Date createDate;

	@TableField("create_by")
	private String createBy;

	@TableField("bills_status")
	private int billsStatus;

	@TableField("invoice_status")
	private int invoiceStatus;

	@TableField(exist = false)
	private String vendorName;

	@TableField(exist = false)
	private String poType;

	@TableField(exist = false)
	private String companyName;

	@TableField(exist = false)
	private String poCategory;

	@TableField(exist = false)
	private String purchGroup;

	@TableField(exist = false)
	private String purchOrg;

	@TableField(exist = false)
	private String payCondition;

	@TableField(exist = false)
	private String currencyCode;
}
